using System;
using System.Collections.Generic;

namespace Client
{
	public class Filtre
	{
		protected List<Music> m_Musics;
		protected string m_Label;
		
		public Filtre (Collection p_collection, string p_value, Predicate<Music> p_PredicateSearch) {
			m_Musics = p_collection.Musics.FindAll(p_PredicateSearch);
			m_Label = p_value;
		}
		
		
		public List<Music> Musics {
			get {
				return m_Musics;
			}
		}
		
		public string Label {
			get {
				return m_Label;
			}
		}
		
		public bool IsSelected {
			get {
				foreach(Music music in m_Musics) {
					if(!music.IsSelected)
						return false;
				}
				
				return true;
			}
			set {
				foreach(Music music in m_Musics)
					music.IsSelected = value;
			}
		}
	}
}

